package org.smart4j.framework.bean;

import org.smart4j.framework.utils.CastUtil;

import java.util.Map;

/**
 * Created by Wenxin on 2017/2/26.
 */
public class Param {

    private Map<String,Object> paramMap;

    public Param(Map<String,Object> paramMap){
        this.paramMap = paramMap;
    }

    /**
     * 根据参数名获取Long类型参数
     * @param name
     * @return
     */
    public Long getLong(String name){
        return Long.valueOf((String) paramMap.get(name));
    }

    public String getString(String name){
        return (String) paramMap.get(name);
    }

    public Integer getInteger(String name){
        return (Integer) paramMap.get(name);
    }

    public Double getDouble(String name){
        return (Double) paramMap.get(name);
    }

    public Object getObject(String name){
        return (Object) paramMap.get(name);
    }

    public Boolean getBoolean(String name){
        return (Boolean) paramMap.get(name);
    }

    /**
     * 获取所有字段信息
     * @return
     */
    public Map<String,Object> getMap(){
        return paramMap;
    }

}
